package 笔试.京东;

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class 下一个字典序字符串 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        String ans = solve(str);
        if (ans == null) {
            System.out.println(-1);
        } else {
            System.out.println(ans);
        }
    }

    private static String solve(String str) {
        StringBuilder sb = new StringBuilder();
        int len = str.length();
        int index = -1;
        for (int i = len - 1; i >= 0; i--) {
            if (str.charAt(i) != 'z') {
                index = i;
                break;
            }
        }
        if (index == -1) {
            return null;
        }
        sb.append(str, 0, index);
        sb.append((char) (str.charAt(index) + 1));
        if (index + 1 < str.length()) {
            sb.append(str.substring(index + 1));
        }
        return sb.toString();
    }
}